//
//  MNDRegisterBottomView.m
//  minidai
//
//  Created by Steven.Yung on 2017/5/6.
//  Copyright © 2017年 迷你金服. All rights reserved.
//

#import "MNDRegisterBottomView.h"
#import "UIButton+JKImagePosition.h"

@interface MNDRegisterBottomView ()

@end

@implementation MNDRegisterBottomView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self.referrerBtn jk_setImagePosition:LXMImagePositionRight spacing:3.0];
    
    [self.backToLoginBtn jk_setImagePosition:LXMImagePositionRight spacing:0.0];
    
    NSString *string = @"如有填写推荐人，注册并出借成功，双方各得1%赠利券。如无推荐人请留空";
    NSRange percentRange = [string rangeOfString:@"1%赠利券" options:NSCaseInsensitiveSearch];
    NSRange awardsRange = [string rangeOfString:@"18元" options:NSCaseInsensitiveSearch];
    
    NSMutableAttributedString *attrString = [[NSMutableAttributedString alloc] initWithString:string];
    
    [attrString addAttributes:@{NSForegroundColorAttributeName: kColorOrange} range:percentRange];
    [attrString addAttributes:@{NSForegroundColorAttributeName: kColorOrange} range:awardsRange];
    
    self.rewardsLabel.attributedText = attrString;
}

@end
